home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48_2 / star-1_0.tar / instr.c < prev    next >
C/C++ Source or Header  |  1991-03-22  |  5KB  |  167 lines

  1. /* instr.c -- STAR Instruction Table
  2.  
  3. This file is part of STAR, the Saturn Macro Assembler.
  4.  
  5.    STAR is not distributed by the Free Software Foundation. Do not ask
  6. them for a copy or how to obtain new releases. Instead, send e-mail to
  7. the address below. STAR is merely covered by the GNU General Public
  8. License.
  9.  
  10. Please send your comments, ideas, and bug reports to
  11. Jan Brittenson <bson@ai.mit.edu>
  12.  
  13. */
  14.  
  15.  
  16. /* Copyright (C) 1990, 1991 Jan Brittenson.
  17.  
  18.    STAR is free software; you can redistribute it and/or modify it
  19. under the terms of the GNU General Public License as published by the
  20. Free Software Foundation; either version 1, or (at your option) any
  21. later version.
  22.  
  23.    STAR is distributed in the hope that it will be useful, but WITHOUT
  24. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  25. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  26. for more details.
  27.  
  28.    You should have received a copy of the GNU General Public License
  29. along with STAR; see the file COPYING. If not, to obtain a copy, write
  30. to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139,
  31. USA, or send e-mail to bson@ai.mit.edu. */
  32.  
  33.  
  34. #include <stdio.h>
  35. #include "sects.h"
  36. #include "star.h"
  37.  
  38. extern void
  39.  
  40.   /* Instructions */
  41.   byte1(), fadd(), fbits(), fbrb(), fbrc(), fbrt(), fin(), fmove(),
  42.   fout(), frel(), frotw(), fshfn(), fsrb(), fsub(), fswap(), opc1(),
  43.   opd1(), opsd1(), word3(), word4(), word5(), fslb(),
  44.  
  45.   /* Directives */
  46.   dbyte(), ddata(), dif(), delse(), dany(), dendif(), drept(),
  47.   ddef(), dorg(), dasc(), dascz(), dalign(), dodd(), deven(),
  48.   derror(), dend(), dexit(), dsave(), drestore(), dmacro(), dradix(),
  49.   dhide(), dstatic(), dfloating(), ddoblock(), ddouble(), ddumpsym(),
  50.   dlibcall(), dsect(), dkbegin();
  51.  
  52.  
  53. /* Instruction table:
  54.  *
  55.  *    Name        Func    Length, Opcode
  56.  */
  57. struct istruct    instbl[] = {
  58.     {"ADD",        fadd,    0, 0},
  59.     {"ALIGN",    dalign,    1, 0},
  60.     {"AND",        opsd1,    0, 0},
  61.     {"ANY",        dany,    4, 0},
  62.     {"ASCII",    dasc,    1, 0},
  63.     {"ASCIZ",    dascz,    1, 0},
  64.     {"ASECT",    dsect,    0, SC_ASECT},
  65.     {"BRBC",    fbrb,    0, 0},
  66.     {"BRBS",    fbrb,    0, 1},
  67.     {"BRCC",    fbrc,    0, 0},
  68.     {"BRCS",    fbrc,    0, 1},
  69.     {"BREQ",    fbrt,    0, 0},
  70.     {"BRGE",    fbrt,    1, 8},
  71.     {"BRGT",    fbrt,    1, 0},
  72.     {"BRLE",    fbrt,    1, 0xc},
  73.     {"BRLT",    fbrt,    1, 4},
  74.     {"BRNE",    fbrt,    0, 4},
  75.     {"BRNZ",    fbrt,    0, 0xc},
  76.     {"BRZ",        fbrt,    0, 8},
  77.     {"BUSCB",    word4,    0, 0x3808},
  78.     {"BUSCC",    word3,    0, 0xb08},
  79.     {"BUSCD",    word4,    0, 0xd808},
  80.     {"BYTE",    dbyte,    1, 0},
  81.     {"CALL",    frel,    0, 0},
  82.     {"CLR",        opd1,    0, 1},          /* 1 = 0xA8/D */
  83.     {"CLRB",    fbits,    0, 0},
  84.     {"CONFIG",    word3,    0, 0x508},
  85.     {"CSECT",    dsect,    0, SC_CSECT},
  86.     {"DATA",    ddata,    0, 0},
  87.     {"DEC",        opd1,    0xc, 0},      /* 0 = 0xA0/C */
  88.     {"DEF",        ddef,    3, 1},
  89.     {"DEFINE",    ddef,    3, 0},
  90.     {"DOBLOCK",    ddoblock,0,0},
  91.     {"DOUBLE",    ddouble, 0, 0},
  92.     {"DSECT",    dsect,    0, SC_DSECT},
  93.     {"DUMPSYM",    ddumpsym, 0, 0},
  94.     {"ELSE",    delse,    2, 0},
  95.     {"END",        dend,    0, 0},
  96.     {"ENDIF",    dendif,    4, 0},
  97.     {"ERROR",    derror,    0, 0},
  98.     {"EVEN",    deven,    0, 0},
  99.     {"EXIT",    dexit,    0, 0},
  100.     {"FLOATING",    dfloating, 0, 0},
  101.     {"HIDE",    dhide,  0, 0},
  102.     {"IF",        dif,    1, 0},
  103.     {"IN",        fin,    0, 0},
  104.     {"INC",        opd1,    4, 2},          /* 2 = 0xB0/E */
  105.     {"INTOFF",    word4,    0, 0xf808},
  106.     {"INTON",    word4,    0, 0x0808},
  107.     {"JUMP",    frel,    0, 1},
  108.     {"KBEGIN",    dkbegin, 0, 0},
  109.     {"LIBCALL",    dlibcall, 0,0},
  110.     {"LSECT",    dsect,    0, SC_LSECT},
  111.     {"MACRO",    dmacro,    0, 0},
  112.     {"MOVE",    fmove,    0, 0},
  113.     {"NEG",        opd1,    8, 3},          /* 3 = 0xB8/F */
  114.     {"NOP3",    word3,    0, 0x024},
  115.     {"NOP4",    word4,    0, 0x0036},
  116.     {"NOP5",    word5,    0, 0x00046},
  117.     {"NOT",        opd1,    0xc, 3},
  118.     {"ODD",        dodd,    0, 0},
  119.     {"OR",        opsd1,    0, 8},
  120.     {"ORG",        dorg,    1, 0},
  121.     {"ORIGIN",    dorg,    2, 0},
  122.     {"OUT",        fout,    0, 0},
  123.     {"POP",        opc1,    R_C, 0x70},
  124.     {"PSECT",    dsect,    0, SC_PSECT},
  125.     {"PUSH",    opc1,    R_C, 0x60},
  126.     {"RADIX",    dradix,    0, 0},
  127.     {"REPT",    drept,    1, 0},
  128.     {"RESET",    word3,    0, 0xa08},
  129.     {"RESTORE",    drestore, 0, 0},
  130.     {"RET",        byte1,    0, 0x10},
  131.     {"RETBC",    fbrb,    1, 0},
  132.     {"RETBS",    fbrb,    1, 1},
  133.     {"RETCC",    fbrc,    1, 0},
  134.     {"RETCLRC",    byte1,    0, 0x30},
  135.     {"RETCS",    fbrc,    1, 1},
  136.     {"RETEQ",    fbrt,    2, 0},
  137.     {"RETGE",    fbrt,    3, 8},
  138.     {"RETGT",    fbrt,    3, 0},
  139.     {"RETI",    byte1,    0, 0xf0},
  140.     {"RETLE",    fbrt,    3, 0xc},
  141.     {"RETLT",    fbrt,    3, 4},
  142.     {"RETNE",    fbrt,    2, 4},
  143.     {"RETNZ",    fbrt,    2, 0xc},
  144.     {"RETSETC",    byte1,    0, 0x20},
  145.     {"RETSETXM",    byte1,    0, 0x00},
  146.     {"RETZ",    fbrt,    2, 8},
  147.     {"RLN",        frotw,    0, 0},
  148.     {"RRN",        frotw,    0, 4},
  149.     {"RSI",        word5,    0, 0x01808},
  150.     {"SAVE",    dsave,    0, 0},
  151.     {"SETB",    fbits,    0, 1},
  152.     {"SETDEC",    byte1,    0, 0x50},
  153.     {"SETHEX",    byte1,    0, 0x40},
  154.     {"SHUTDN",    word3,    0, 0x708},
  155.     {"SLB",        fslb,    0, 0},
  156.     {"SLN",        fshfn,    0, 0},
  157.     {"SRB",        fsrb,    0, 0},
  158.     {"SREQ",    word3,    0, 0xe08},
  159.     {"SRN",        fshfn,    0, 4},
  160.     {"STATIC",    dstatic,0, 0},
  161.     {"SUB",        fsub,    0, 0},
  162.     {"SUBN",    fsub,    0, 1},
  163.     {"SWAP",    fswap,    0, 0},
  164.     {"UNCNFG",    word3,    0, 0x408},
  165.     {"",        byte1,    0, 0}
  166.     };
  167.